<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <title>浏览页面</title>
    <link rel="stylesheet" href="/app/admin/component/pear/css/pear.css"/>
    <link rel="stylesheet" href="/app/admin/admin/css/reset.css"/>
</head>
<body>
<form class="layui-form">

    <div class="mainBox">
        <div class="main-container mr-5">
            <div class="layui-form-item">
                <label class="layui-form-label required">自定义标签</label>
                <div class="layui-input-block">
                    <input type="text" name="custom_tags" lay-verify="required" placeholder="请输入标签" class="layui-input">
                    <tip>多个用英文逗号,隔开</tip>
                </div>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-md" lay-submit="" lay-filter="save">
                提交
            </button>
            <!--<button type="reset" class="pear-btn pear-btn-md">-->
            <!--重置-->
            <!--</button>-->
        </div>
    </div>
</form>
<script src="/app/admin/component/layui/layui.js?v=2.8.12"></script>
<script src="/app/admin/component/pear/pear.js"></script>
<script src="/app/admin/component/jsoneditor/jsoneditor.js"></script>
<script src="/app/admin/admin/js/permission.js"></script>
<script src="/app/admin/admin/js/functions.js"></script>
<script src="/app/admin/admin/js/md5.js"></script>
<script>
    const UPDATE_API = "/app/admin/novel/index/customtags";

    // 字段 文件 url
    layui.use(["form", "popup","loading"], function () {
        layui.form.on("submit(save)", function (data) {
            data.field['ids'] = layui.url().search['ids'];
            let loading = layer.load();
            layui.$.ajax({
                url: UPDATE_API,
                type: "POST",
                dateType: "json",
                data: data.field,
                async:true,
                headers: get_header(data.field),
                success: function (res) {
                    layer.close(loading);
                    if (res.code) {
                        return layui.popup.failure(res.msg);
                    }
                    return layui.popup.success("操作成功", function () {
                        parent.refreshTable();
                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                    });
                }
            });
            return false;
        });
    });

</script>
</body>
</html>